import { FC } from "react";
import { getComponentByType } from "../../../questioncomponents";
type StateEchartType = {
    selectedId:string
}


const StateEchart:FC<StateEchartType> = (props)=>{
    const {selectedId} = props
    const showStateEchart = (selectedId:string)=>{
        const componentConfig = getComponentByType(selectedId)
        if(!componentConfig){
            return
        }
        const {StatComponent} = componentConfig
        if(!StatComponent){
            return <>该属性上不存在图表组件</>
        }
        return <StatComponent></StatComponent>
    }

    return <>
        {showStateEchart(selectedId)}
    </>
}

export default StateEchart